<template>
  <view class="styleMessageList">
    <!-- <toast></toast> -->
    <!-- <u-navbar :title="options.title" :bgColor="navbarClass.titleBgColor" @leftClick="backHome" :placeholder="true"> </u-navbar> -->
    <view class="workCont" v-if="!loadingShow">
      <view class="text1" v-for="(v, i) in dtNewsVoList" :key="i" @click="gotoJump('/pageContent/affair/message', v)">
        <text class="txt2 u-line-2">{{ v.title }}</text>
        <u-icon name="arrow-right" color="#999" size="18"></u-icon>
      </view>

      <view class="noList" v-if="!(dtNewsVoList && dtNewsVoList.length)">
        <img src="../../static/image/noList.png" />
        <view class="textTip">暂无信息</view>
      </view>
    </view>

    <view class="loading" v-if="loadingShow"><u-loading-icon></u-loading-icon></view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      options: {},
      loadingShow: true,
      dtNewsVoList: [],
    }
  },
  onLoad(options) {
    this.options = options
    this.findArticleList()
  },
  onShow() {
    uni.setNavigationBarTitle({
      title: this.options.title,
    })
  },
  methods: {
    findArticleList() {
      this.loadingShow = true
      this.$https
        .post({
          url: '/axh/articleManage/findArticleList',
          data: {
            oneClassifyId: 26,
            twoClassifyId: this.options.twoClassifyId,
            threeClassifyId: this.options.pidStr,
            fourClassifyId: this.options.fourClassifyId,
            page: 1,
            limit: 200,
            status: 1,
            phoneAuth: 1,
          },
        })
        .then((data) => {
          this.loadingShow = false
          this.dtNewsVoList = data.result.dtNewsVoList
        })
    },
    switchTab(e) {
      console.log(e)
    },

    gotoJump(url, item) {
      if (item.articleType == 2) {
        //#ifdef H5
        location.href = item.content
        //#endif
      } else {
        uni.navigateTo({
          url: `${url}?id=${item.id}`,
        })
      }
    },
  },
}
</script>

<style lang="scss" scoped>
.styleMessageList {
  background: #fff;
  min-height: 100vh;
  .workCont {
    background: #ffffff;
    margin-bottom: 24rpx;

    .text1 {
      display: flex;
      justify-content: space-between;
      font-size: 26rpx;
      padding: 24rpx;
      color: #333333;
      border-bottom: 1px solid #eeeeee;
      .txt2 {
        width: 630rpx;
        line-height: 1.7;
      }
    }
  }
}
.loading {
  margin-top: 50rpx;
}
</style>
